$(function(){
    var id = getvl("id");
    if (id != '') {
        $.ajax({
            url: urlcore + "/api/contacts/contactsDetails?contactsId="+id,
            type: "get",
            dataType: 'json',
            contentType: "application/json;charset=utf-8",
            success:function(data){
                if (data.success == true) {
                    var da = data.data;
                    $('#id').text(da.address.id);
                    $('#realName').text(da.address.realName);
                    $('#sex').text(da.address.sex);
                    $('#phone').text(da.address.phone);
                    $('#area').text(da.address.province+da.address.city+da.address.county);
                    $('#addressDetail').text(da.address.addressDetail);
                    $('#areaCode').text(da.address.areaCode);
                    $('#gmtDatetime').text(da.address.gmtDatetime);                    
                } else if (data.code == 'OVERTIME'){
                    var thisUrl = window.location.href;
                    if (thisUrl.indexOf('login.html') <= -1) {
                        top.window.location.href="login.html";
                    }
                } else {
                    alert(data.msg);
                }
            },
            error:function() {
                /* Act on the event */
                alert("error");
            }
        });
    }

});
